package BullFightGame;

import java.util.Random;

public class Play {
	 Role [] role =new Role[2];
	 boolean [] pokers =new boolean[54];
	
     public Play() {
        role [0]=new Role("萧燚");
        role [1]=new Role("智妍");
        initPokers();
       
	}
     
    public void initPokers(){
    for(int i=0;i<pokers.length;i++){
        pokers[i]=false;
         }
    } 
 	public void getPokers(){
		Random r =new Random();
		int j=0;
		for(int k=0;k<role.length;k++){
		for(int i=0;i<5;i++){
			while (true){
				j=r.nextInt(54);
				if(pokers[j]==false){
					role[k].hand.decks[i]=new Deck(j+1);
					pokers[j]=true;
					break;
				}
			}
				
		}
	 }		
	}

     
	public void look(){
      for(int i=0;i<role.length;i++){
    	   role[i].look();
      }
	}
	public void judge(){
		int result= role[0].hand.compare(role[1].hand);
		if(result==1){
			System.out.println(role[0].getName()+"胜"+role[1].getName());
		}
		else 	if(result==0){
			System.out.println(role[0].getName()+"平"+role[1].getName());
		}
		else  if(result==-1){
			System.out.println(role[0].getName()+"负"+role[1].getName());
		}
		
	}
    
     
	 


}
